<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <title>getUserLanguage - Standard Library - Prails API Documentation</title>
    </head>
    <body>
        <h3 class="P4"><a name="_getUserLanguage"><span/></a>getUserLanguage</h3><h4 class="Heading_20_4"><a name="_Description_"><span/></a>Description:</h4>
        <p class="Text_20_body">
            Retrieves the language settings preferred by the user.
        </p>
        <h4 class="Heading_20_4"><a name="_Syntax_"><span/></a>Syntax:</h4>
        <p class="Text_20_body">
            <code>String getUserLanguage($arr_allowedLangs, $str_defaultLang)</code>
        </p>
        <table border="0" cellspacing="0" cellpadding="0" class="Table21">
            <colgroup>
                <col width="180"/><col width="563"/>
            </colgroup>
            <tr>
                <td style="text-align:left;width:4.11cm; " class="Table21_A1">
                    <p class="Table_20_Contents">
                        $arr_allowedLangs
                    </p>
                </td>
                <td style="text-align:left;width:12.889cm; " class="Table21_B1">
                    <p class="Table_20_Contents">
                        List of RFC4646 compliant language identifiers (like "en-us" or "de-de")
                    </p>
                </td>
            </tr>
            <tr>
                <td style="text-align:left;width:4.11cm; " class="Table21_A2">
                    <p class="Table_20_Contents">
                        $str_defaultLang
                    </p>
                </td>
                <td style="text-align:left;width:12.889cm; " class="Table21_B2">
                    <p class="Table_20_Contents">
                        Default language that should be used, if no language preferences can be identified - also RFC4646 compliant
                    </p>
                </td>
            </tr>
        </table>
        <p class="Text_20_body">
            <span class="T1">Returns: </span>RFC4646 compliant language identifier
        </p>
        <h4 class="Heading_20_4"><a name="_Example_"><span/></a>Example:</h4>
        <pre>
            if ( getUserLanguage(
                    Array("de-de", "es-br", "en-us", "en-uk", "en-au"), 
                    "en-us"
                 ) == "es-br" ) {
                echo "You prefer speaking spanish? Como esta usted?"
            } 
		</pre>
    </body>
</html>
